/*--------------------------------------------------------------------------
  Project::HEXAGON FLIGHT SIMULATOR
  Package::Test
  Class::CPUTest
  File CPUTest.h
  --------------------------------------------------------------------------
  * METHODS AND CLASS PARAMETERS


  --------------------------------------------------------------------------
  * FUNCTIONS DESCRIPTION
  
  --------------------------------------------------------------------------
  * COPYRIGHT

  --------------------------------------------------------------------------
  * INFO ABOUT AUTHOR AND VERSIONS
  Author:	Tino Giorgio	Data: 
  Rev1:			Data:

  --------------------------------------------------------------------------
  * E-MAIL & CONTACTS

  GIORGIO TINO:	giorgio.tino@gmail.com

  --------------------------------------------------------------------------*/

#if !defined(CPUTEST_H)
#define CPUTEST_H

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

/* PLIB includes */
#include <plib/ul.h>
#include <plib/sg.h>
#include <plib/ssg.h>

/* Project's includes */
#include "Defines.h"

#define CPUTEST_START 0
#define CPUTEST_STOP  1

class CPUTest  
{
public:
	CPUTest();
	virtual ~CPUTest();

	void testPhysics(int c);
	void testGraphics(int c);
	void testDatabase(int c);
	void testInput(int c);
	void printCPUusage();

private:
	// the inner clock
	ulClock physics_ck;
	ulClock graphics_ck;
	ulClock database_ck;
	ulClock input_ck;

	// total time elapsed for physics and graphics routines
	double physics_t;
	double graphics_t;
	double database_t;
	double input_t;
	double total_t;

	// delta time from last clock
	float physics_dt;
	float graphics_dt;
	float database_dt;
	float input_dt;
};

#endif // !defined(CPUTEST_H)
